home *** CD-ROM | disk | FTP | other *** search
- unit TstCopyu;
-
- interface
-
- uses
- Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
- StdCtrls;
-
- type
- TForm1 = class(TForm)
- Button1: TButton;
- edSourceFile: TEdit;
- edDestFile: TEdit;
- Label1: TLabel;
- Label2: TLabel;
- procedure Button1Click(Sender: TObject);
- private
- { Private declarations }
- public
- { Public declarations }
- end;
-
- var
- Form1: TForm1;
-
- implementation
-
- uses
- AAThdCpy;
-
- {$R *.DFM}
-
- procedure TForm1.Button1Click(Sender: TObject);
- var
- File1 : TFileStream;
- File2 : TFileStream;
- begin
- File1 := nil;
- File2 := nil;
- try
- Button1.Enabled := false;
- File1 := TFileStream.Create(edSourceFile.Text, fmOpenRead + fmShareDenyNone);
- File2 := TFileStream.Create(edDestFile.Text, fmCreate);
- AAThreadedCopyStream(File1, File2);
- finally
- File1.Free;
- File2.Free;
- Button1.Enabled := true;
- end;
- end;
-
- end.
-